.\" Copyright (c) 2009 Kai Wang
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd August 3, 2009
.Dt UHIDD 8
.Os
.Sh NAME
.Nm uhidd
.Nd USB HID daemon
.Sh SYNOPSIS
.Nm
.Op Fl c Ar file
.Op Fl dhkKmMuv
.Ar /dev/ugen%u.%u
.Sh DESCRIPTION
The
.Nm
daemon handles USB HID devices like mouse, keyboard etc. in userland using
the libusb20 library.
.Pp
The
.Nm
daemon is intended to handle USB HID devices with multiple logical
devices sharing one endpoint, usually that is multiple application
collections inside one interface. The daemon attaches each HID
interface of the ugen%u.%u device as a HID parent device, and the
application collections inside that inteface as the HID child
devices. HID parent devices receive data through the shared interrupt
endpoint and pass it to the right HID child device.  The child device
then process the data as approriate.
.Pp
There are currently 3 kinds of HID child devices: Mouse device, Keyboard
device, and General HID device. The Mouse child device pass the mouse
data to the console driver to make it available to the text console
and user programs. The Keyboard child device create a
.Xr vkbd 4
virtual keyboard and pass the keyboard scancodes to it.
All other HID devices fall into the category of General HID device.
The General HID child device creates a virtual USB HID device using
the
.Xr uvhid 4
driver, so normal usb hid applications that deal with
.Xr uhid 4
could access the data through the virutal device.
.Sh OPTIONS
The
.Nm
daemon supports the following options:
.Bl -tag -width indent
.It Fl c Ar file
Specify the path to the configuration file. The default path
is /usr/local/etc/uhidd.conf
.It Fl d
Do not detach from the controlling terminal, i.e., run in
foreground. This option is intended for debugging the daemon.
.It Fl h
Attach General HID child device. (This is the default behaviour)
This option requires that uvhid(4) driver compiled in the kernel
or loaded as a kernel module.
.It Fl k
Attach Keyboard HID child device. The option requires that
.Xr vkbd 4
compiled in the kernel or loaded as a kernel module.
.It Fl K
Attach Keyboard as a General HID child device. If this options
is spcified, keyboard child device will apprear as a
.Xr uvhid 4
device instead of a
.Xr vkbd 4
device. This option implies
.Fl k .
.It Fl m
Attach Mouse HID child device. (This is the default behaviour)
.It Fl M
Attach Mouse as a General HID child device. This option impiles
.Fl m .
.It Fl v
Output additional information for debugging purpose. Multiple
.Fl v
specified in the command line will increase the level of the
verbosity. This option implies
.Fl d .
.Sh SEE ALSO
.Xr usbhidaction 1 ,
.Xr usb 3 ,
.Xr uhid 4 ,
.Xr uvhid 4 ,
.Xr vkbd 4 ,
.Xr bthidd 8 ,
.Xr moused 8
.Sh AUTHORS
.An Kai Wang Aq kaiw@FreeBSD.org
